package es.sag.deck;

public class Card {
  public enum Value {
    ACE("A", 1),
    TWO("2", 2),
    THREE("3", 3),
    FOUR("4", 4),
    FIVE("5", 5),
    SIX("6", 6),
    SEVEN("7", 7),
    EIGHT("8", 8),
    NINE("9", 9),
    TEN("10", 10),
    JACK("J", 11),
    QUEEN("Q", 12),
    KING("K", 13);
    
    private String abbr;
    private int value;
    
    Value(String abbr, int value) {
      this.abbr = abbr;
      this.value = value;
    }
    
    public String getAbbr() {
      return abbr;
    }
    
    public int getValue() {
      return value;
    }
  }
  
  public enum Suite {
    SPADES, 
    HEARTS, 
    CLUBS, 
    DIAMONDS;
  }
  
  private Value value;
  private Suite suite;
  
  private int mnemonicPos;
  
  public Card(int mnemonicPos, Value value, Suite suite) {
    this.mnemonicPos = mnemonicPos;
    this.value = value;
    this.suite = suite;
  }
  
  public Value getValue() {
    return value;
  }
  
  public Suite getSuite() {
    return suite;
  }
  
  public int getMnemonicPosition() {
    return mnemonicPos;
  }
  
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append(value).append(" - ").append(suite);
    sb.append(" [").append(mnemonicPos).append("]");
    
    return sb.toString();
  }
}
